<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>手机秒杀列表</title>
    <script type="text/javascript" th:inline="javascript">
        /*<![CDATA[*/
        ctxPath = /*[[@{/}]]*/ '';
        /*]]>*/
        console.info(ctxPath);
        var basePath = '[[${#httpServletRequest.getScheme() + "://" + #httpServletRequest.getServerName() + ":" + #httpServletRequest.getServerPort() + #httpServletRequest.getContextPath()}]]';
        console.log(basePath)
    </script>　
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>商品编号</th>
                <th>商品名称</th>
                <th>商品价格</th>
                <th>商品详情</th>
            </tr>
        </thead>
        <tbody>
            <tr th:each="phone:${phoneList}">
                <td th:text="${phone.id}">$phone.id</td>
                <td th:text="${phone.name}"></td>
                <td th:text="${phone.price}"></td>
                <td><a th:href="@{'/phone/' + ${phone.id}}" target="_blank">查看详情</a></td>
            </tr>
        </tbody>
    </table>
</body>
</html>